home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Diamond Collection / The Diamond Collection (Software Vault)(Digital Impact).ISO / cdr29 / wpsec102.zip / DEINSTAL.CMD < prev    next >
OS/2 REXX Batch file  |  1995-03-04  |  3KB  |  119 lines

  1. /******************************************************************/
  2. /* DEINSTAL.CMD Workplace Security deinstallation utility            */
  3. /*                                                                */
  4. /* Workplace Security Copyright (C) 1995 by Maple Valley Software */
  5. /******************************************************************/
  6.   
  7. '@Echo Off'
  8.  
  9.  
  10. /* Load REXXUTIL */
  11.  
  12. Call RxFuncAdd 'SysLoadFuncs', 'REXXUTIL', 'SysLoadFuncs'
  13. Call SysLoadFuncs
  14.  
  15. /* Initialize */
  16.  
  17. Signal On Failure Name FAILURE
  18. Signal On Halt Name HALT
  19. Signal On Syntax Name SYNTAX
  20.  
  21.  
  22. Call SysCls
  23. say ' '
  24. say ' '
  25. say 'Removing Workplace Security... '
  26. Say ' '
  27. Say '** Warning ** Unlock all locked objects'
  28. say 'before removing Workplace Security!'
  29. Say ' '
  30.  
  31. current_directory = directory() /* get current directory */
  32.  
  33. /* Find the drive for the d:\OS2\DLL directory */
  34.  
  35. Drives = SysDriveMap(C,'LOCAL')
  36.    do words(drives)
  37.       parse var drives drive drives
  38.       directory = drive||'\OS2\DLL'
  39.       Result = SysFileTree(Directory,'Dirs','D')
  40.       If Dirs.0 > 0 Then signal ASKDRIVE
  41.       end
  42.  
  43. /* Ask for the OS/2 boot drive */
  44. ASKDRIVE:
  45. Say 'Please enter the drive letter of your'
  46. Say 'OS/2 boot drive. (default' drive ')'
  47. Say 'or type "Q" to quit the deinstall.'
  48. Parse upper pull bootdrive ':' .
  49.  
  50. if bootdrive = "Q" Then signal DONE
  51. If bootdrive > "" Then drive  = bootdrive||':'
  52.  
  53. /* Verify the directory exists. */
  54. Result = SysFileTree( drive||"\OS2\DLL", 'Dirs', 'D' )
  55. If Dirs.0 = 0 Then
  56.   Do
  57.   Say ' '
  58.   Say 'OS/2 could not be found on drive' drive||':'
  59.   Say ' '
  60.   Signal ASKDRIVE
  61.   End
  62.  
  63. Result = SysFileTree(drive||'\OS2\DLL\WPSECURE.DLL', 'Dirs', 'O' )
  64. If Dirs.0 = 0 Then Do 
  65.    /* WPSECURE.DLL not found */
  66.    Say  "Workplace Security is not currently installed"
  67.    exit
  68.    End
  69. Else Do /* build removal cmd */
  70.    fStartupExists = 0
  71.    SAY 'Removing Workplace Security'
  72.    startup_cmd = drive||'\STARTUP.CMD'
  73.    wpsecure_cmd = directory()||"\WPSECURE.CMD"
  74.    callcmd = "call "wpsecure_cmd
  75.    Result = SysFileTree(drive||'\STARTUP.CMD', 'Dirs', 'O' )
  76.    If Dirs.0 <> 0 Then Do
  77.          fStartupExists = 1
  78.          "copy" startup_cmd drive||"\STARTUP.WPS 1>NULL"  /* save current startup.cmd */
  79.          'DEL' startup_cmd 
  80.          End
  81.    rc = lineout(startup_cmd,callcmd)
  82.    'DEL' wpsecure_cmd
  83.    rc = lineout(wpsecure_cmd,'@echo off')
  84.    rc = lineout(wpsecure_cmd,'echo Removing Workplace Security')
  85.    rc = lineout(wpsecure_cmd,'DEL'  drive||'\OS2\DLL\WPSECURE.DLL')
  86.    rc = lineout(wpsecure_cmd,'DEL'  drive||'\OS2\HELP\WPSECURE.HLP')
  87.    if fStartupExists = 1 then do   
  88.          rc = lineout(wpsecure_cmd,'COPY' drive||'\STARTUP.WPS' startup_cmd '1>NULL')
  89.          rc = lineout(wpsecure_cmd,'DEL' drive||'\STARTUP.WPS')
  90.          rc = lineout(wpsecure_cmd,'CALL' startup_cmd)
  91.          End
  92.    else  Do
  93.          rc = lineout(wpsecure_cmd,'DEL' startup_cmd)  
  94.          rc = lineout(wpsecure_cmd,'Exit')
  95.          End
  96.    End
  97.  
  98. 'REMOVE'
  99. say ' '
  100. Say ' '
  101. Say 'Shutdown and Re-boot to complete Workplace Security removal'
  102. Say ' '
  103. Signal DONE
  104.  
  105. FAILURE:
  106. Say 'REXX failure.'
  107. Signal DONE
  108.  
  109. HALT:
  110. Say 'REXX halt.'
  111. Signal DONE
  112.  
  113. SYNTAX:
  114. Say 'REXX syntax error.'
  115. Signal DONE
  116.  
  117. DONE:
  118. Exit
  119.